<?php
final class FrontController extends CController
{
	public function actionHandleRequest()
	{
		$route = Yii::app()->getUrlManager()->parseUrl(Yii::app()->getRequest());
		if ($route) {
			Yii::app()->runController($route);
			return;
		}
		$siteRoute = urldecode(trim(Yii::app()->getRequest()->getPathInfo(), '/'));
		$this->handleSiteRoute($siteRoute);
	}

	private function handleSiteRoute($siteRoute)
	{
		if ('admin' == $siteRoute) {
			Yii::app()->runController('admin/index/index');
			return;
		}
	}
}